package collection;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ListT {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        for (int i=0;i<10;i++){
            System.out.println("请输入第"+(i+1)+"个元素");
            String str= scanner.nextLine();
            list.add(str);
        }
        String e5= list.get(5);
        System.out.println(e5);
        String target1=scanner.nextLine();//转换
        String target2=scanner.nextLine();

        int idex1= list.indexOf(target1);
        int idex2= list.indexOf(target2);
        System.out.println(idex1);
        System.out.println(idex2);

        list.remove(3);
        System.out.println(list);
        scanner.close();
    }
}